initialize

open fun initialize(module: Module)

Initializes the control with its associated module context.

This method is typically called once before the control is first used or made active. It allows the control to set up its internal state, resources, and prepare for operation based on the provided data.

If #isAutoStart() is true, implementations might also trigger their start logic within or immediately after initialization.

Initializes the WebView with the provided module configuration. This method parses the options from the module to configure the WebView's behavior, such as the URL to load, refresh interval, HTML content, basic authentication credentials, cache mode, and user agent.

If the "Uri" option is present, it sets the URL to load. It automatically prepends "http://" if the URL doesn't start with "http://" or "https://". If the "WebApp" option is present, it configures the WebView to load a local web application using WebViewAssetLoader. The assets are expected to be in a directory specific to the module ID. If the "Refresh" option is present, it sets the refresh interval in milliseconds. If the "Html" option is present, it sets the HTML content to be loaded directly. If the "BasicAuthCredentials" option is present, it stores the credentials for basic authentication. If the "CacheMode" option is present, it configures the WebView's cache behavior. Possible values are "Cache First", "Cache Only", "No Cache", "Custom Cache", or defaults to LOAD_DEFAULT. If the "UserAgent" option is present, it sets the user agent string for the WebView.

Parameters

module

The module containing the configuration options for this WebView.